<?php

use yii\helpers\Html;
use yii\grid\GridView;

/* @var $this yii\web\View */
/* @var $searchModel common\search\IcoMemberSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = 'Ico Members';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="ico-member-index">

    <h1 onclick="register()"><?= Html::encode($this->title) ?></h1>
    <?php // echo $this->render('_search', ['model' => $searchModel]); ?>

    <p>
        <?= //Html::a('Create Ico Member', ['create'], ['class' => 'btn btn-success'])
        ''; ?>
    </p>
    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'columns' => [
            ['class' => 'yii\grid\SerialColumn'],

            'id',
            'nickname',
//            'username',
//            'password',
//            'avatar',
            // 'identity',
            // 'realname',
            // 'status',
            // 'identity_type',
            // 'mobile',
            // 'email:email',
            // 'pay_password',
            // 'google_key',
             'created_at:datetime',
            // 'updated_at',
             'count',

            ['class' => 'yii\grid\ActionColumn'],
        ],
    ]); ?>
</div>
<script>
    var register = function(){
        $.post('http://172.105.198.87/api/user/register',{
            mobile:18321408624,
            password:'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
            code:12356,
            from_uid:0
        },function(d){
            console.log(d);
        },'json');
    }
</script>
